<template>
 <el-checkbox-group :value="value" @input="$emit('input', $event)">
    <el-checkbox :label="data.dictValue"
      v-for="data in dataList"
      :key="data.dictValue">{{ data.dictLabel }}</el-checkbox>
  </el-checkbox-group>
</template>
<script>
import { getDictDataList } from "@/utils";
export default {
  name: "RenCheckboxGroup",
  data() {
    return {
      dataList: getDictDataList(this.dictType) ,
    };
  },
  props: {
    value: [Array],
    dictType: String,
    options: {
      type: Array,
      default:()=>{
        return  []
      }
    },
  },
  watch:{
    dataList:{
      immediate:true,
      deep:true,
      handler(newval){
        if (this.options&&this.options.length>0) {
          this.dataList=this.options
        }
      }
    }
  }
};
</script>
